/**
 * Project Name:javaBaseReview
 * Package Name:com.xuwei.proxy
 * author:David
 * Date:2015年6月7日上午10:19:58
 * Copyright (c) 2015, xw123box@126.com All Rights Reserved.
 *
 */
package com.xuwei.ext.proxy;

import java.lang.reflect.Method;

/**
 * @author David since 2015年6月7日 上午10:19:58
 * @version
 * @since JDK 1.6
 */
public class MyAdvice implements Advice {
	long beginTime=0;
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.xuwei.proxy.Advice#beforeMethod()
	 */
	@Override
	public void beforeMethod(Method method) {
		// TODO Auto-generated method stub
		System.out.println("invoke start...");
		beginTime = System.currentTimeMillis();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.xuwei.proxy.Advice#afterMethod()
	 */
	@Override
	public void afterMethod(Method method) {
		// TODO Auto-generated method stub
		long endTime = System.currentTimeMillis();
		System.out.println(method.getName() + " running time of "
				+ (endTime - beginTime));
		System.out.println("invoke end...");
	}

}
